import {Component} from 'react';
import {Row, Col, Button, Empty, Spin} from 'antd';
import DataEchart from '~/component/DataEchart';

class OrderTimeView extends Component {

    // 导出明细
    onDownloadReport = () => {
        const {orderTimeId, onDownloadReport} = this.props;
        onDownloadReport(orderTimeId);
    };

    render() {
        const {isOrderLoading, orderDataMapOtios, orderTimeDataSource} = this.props;
        return (
            <div>
                <Row>
                    <Col span={24} style={{textAlign: 'right'}}>
                        <Button style={{marginTop: 20}} onClick={this.onDownloadReport}>
                            明细导出
                        </Button>
                    </Col>
                </Row>
                <Spin spinning={isOrderLoading} tip="数据加载中...">
                    {
                        orderTimeDataSource.length > 0
                            ? <DataEchart key={231} data={orderDataMapOtios} />
                            : <Empty imageStyle={{height: 70}} image={Empty.PRESENTED_IMAGE_SIMPLE} />
                    }
                </Spin>
            </div>
        );
    }
}

export default OrderTimeView;
